// pages/moment/moment.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    moments: [
      {
        name: "zc",
        avatar: "../../assets/images/avatar/头像1.jpg",
        description: "到此一游",
        photos: [
          "../../assets/images/moment/1.jpg",
          "../../assets/images/moment/2.png",
          "../../assets/images/moment/3.png",
          "../../assets/images/moment/4.png",
          "../../assets/images/moment/5.png",
          "../../assets/images/moment/6.jpg",
          "../../assets/images/moment/7.png",
        ],
        date: "2025-06-14"
      },
      {
        name: "zzcc",
        avatar: "../../assets/images/avatar/头像2.jpg",
        description: "湖州师范学院",
        photos: [
          "../../assets/images/moment/1.jpg",
          "../../assets/images/moment/2.png",
          "../../assets/images/moment/3.png",
          "../../assets/images/moment/4.png"
        ],
        date: "2025-06-13"
      }
    ]

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    const moment = wx.getStorageSync('moment');
    if (moment) {
      this.data.moments.unshift(moment);
      wx.setStorageSync('moment', null);
    }
    this.setData({
      moments: this.data.moments
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  },
navigateToPhoto() {
  wx.navigateTo({
    url: "../../pages/moment/photo/photo"
  })
},

navigateBack() {
  wx.navigateBack();
}
})